package com.yjzx.util.common.util.exception;

import java.util.Objects;

/**
 * @author yjzx
 * @date 2024/8/20
 * @description BiConsumerThrow
 */
@FunctionalInterface
public interface BiConsumerThrow<T, U, E extends Throwable> {

     void accept(T t, U u) throws E;

    /**
     * 连环调用
     *
     * @param after
     * @return
     * @throws Exception
     */
    default BiConsumerThrow<T, U, E> andThen(BiConsumerThrow<T, U, E> after) {
        Objects.requireNonNull(after);
        return (t, u)->{
            this.accept(t, u);
            after.accept(t, u);
        };
    }
}
